FROM openjdk:26-ea-17-jdk-slim AS backend-builder
WORKDIR /app
COPY pom.xml .
COPY .mvn .mvn
COPY mvnw .
RUN ./mvnw dependency:go-offline -B
COPY src ./src
RUN ./mvnw package -DskipTests

FROM openjdk:26-ea-17-jdk-slim AS backend-runtime
WORKDIR /app
COPY --from=backend-builder /app/target/demo-0.0.1-SNAPSHOT.jar ./backend.jar
EXPOSE 8080
CMD ["java", "-jar", "backend.jar"]